﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="UserProfile.aspx.cs" Inherits="TsWeb.Followers.UserProfile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.js" />
            <asp:ScriptReference Path="~/Scripts/bootstrap.min.js" />
        </Scripts>
    </asp:ScriptManager>

         
<div class="well sidebar-nav">
            <ul class="nav nav-list">
              
                
 <li class="nav-header">Mis favoritos</li>
   <asp:GridView ID="GridViewFavorites" runat="server" AutoGenerateColumns="False" 
                CssClass="table table-hover table-striped" GridLines="None" 
             
               >
                <Columns>
                    <asp:BoundField DataField="TeamId" ControlStyle-CssClass="hidden" HeaderStyle-CssClass="hidden"
                        ItemStyle-CssClass="hidden" />
                    <asp:ImageField DataImageUrlField="Image" AlternateText="Imagen del equipo" ControlStyle-CssClass="imageSize" ControlStyle-Height="40px" ControlStyle-Width="40px" />
                    <asp:BoundField DataField="Name" HeaderText="Equipo"  />
                   
                </Columns>
                <RowStyle CssClass="cursor-pointer" />
            </asp:GridView>

            </ul>
          </div><!--/.well -->
        
       
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:UpdatePanel ID="ProfileUpdatePanel" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="UserButton" />
        </Triggers>
        <ContentTemplate>
            <p>
            <h4>Todos los equipos</h4>
            </p>
            <p>
            </p>
            <p>
                <asp:TextBox ID="FilterTextBox" runat="server" Text='<%#Eval("Name") %>'> </asp:TextBox>
                &nbsp;<asp:Button ID="FilterButton" runat="server" Text="Filtrar" OnClick="FilterButton_Click" CssClass="btn" />
                <ajaxToolkit:AutoCompleteExtender ID="FilterAutoCompleteExtender" runat="server"
                    TargetControlID="FilterTextBox" ServiceMethod="GetTeamNames" EnableCaching="true"
                    CompletionSetCount="1" CompletionInterval="100" MinimumPrefixLength="1">
                </ajaxToolkit:AutoCompleteExtender>
            </p>
            <asp:GridView ID="TeamsGrid" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                CssClass="table table-hover table-striped" GridLines="None" AllowSorting="True"
                OnPageIndexChanged="TeamsGrid_PageIndexChanged" OnPageIndexChanging="TeamsGrid_PageIndexChanging"
                OnSorting="TeamsGrid_Sorting" PageSize="10" OnRowCommand="TeamsGrid_RowCommand">
                <Columns>
                    <asp:BoundField DataField="TeamId" ControlStyle-CssClass="hidden" HeaderStyle-CssClass="hidden"
                        ItemStyle-CssClass="hidden" />
                    <asp:ImageField DataImageUrlField="Image" AlternateText="Imagen del equipo" ControlStyle-CssClass="imageSize" ControlStyle-Height="60px" ControlStyle-Width="60px" />
                    <asp:BoundField DataField="Name" HeaderText="Nombre" SortExpression="Name" />
                    <asp:TemplateField HeaderText="Deporte">
                        <ItemTemplate>
                            <asp:Label ID="TeamSportLabel" runat="server" Text='<%# Bind("Sport.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField ButtonType="Link" CommandName="DetailCommand" Text="Detalles" />
                </Columns>
                <RowStyle CssClass="cursor-pointer" />
            </asp:GridView>
    
            <!-- Modal -->
            <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×</button>
                    <h3 id="myModalLabel">
                        <img runat="server" id="TeamLogo" class="img-rounded" alt="Logo del equipo" align="middle" height="60" width="60" /></h3>
                </div>
                <div class="modal-body">
                    <p>
                        <asp:Label ID="TeamNameLabel" runat="server" AssociatedControlID="TeamNameTxt">Nombre:</asp:Label>
                        <asp:TextBox ID="TeamNameTxt" runat="server" CssClass="textEntry" ReadOnly="true"></asp:TextBox>
                    </p>
                    <p>
                        <asp:Label ID="TeamSportLabel" runat="server" AssociatedControlID="TeamSportTxt">Deporte:</asp:Label>
                        <asp:TextBox ID="TeamSportTxt" runat="server" CssClass="textEntry" ReadOnly="true"></asp:TextBox>
                    </p>
                    <p>
                        Comentarios:
                        <asp:ListView ID="ListViewComments" runat="server">
                            <ItemTemplate>
                                <div class="alert alert-info">
                                    <span class="label label-info">
                                        <%#Eval("CmtDate") %></span> &nbsp;&nbsp;&nbsp;&nbsp;
                                    <%#Eval("Text") %>
                                </div>
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                Aún no hay comentarios
                            </EmptyDataTemplate>
                        </asp:ListView>
                        <span class="failureNotification">
                            <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                        </span>
                </div>
                <div class="modal-footer">
                    
                    <asp:Button ID="UserButton" runat="server" Text="Seguir equipo" CssClass="btn btn-primary"
                        OnClick="UserButton_Click" />
                </div>
            </div>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
